const app = getApp()
Component({
    data: {
		selected: 1, //当前选中的tab下标
                selectedTab: 'pages/index/index', // 默认选中的页面路径
                color: "#1E1E1E",
                selectedColor: "#048bd3", //tabbar选中字体颜色
		"list": [{
			"pagePath": "/pages/CheShi3/CheShi3",
			"text": "词册",
			"iconPath": "/images/Book1.png",
			"selectedIconPath": "/images/Book2.png"
		}, {
			"pagePath": "/pages/index/index",
			"text": "首页",
			"iconPath": "/images/Home1.png",
            "selectedIconPath": "/images/Home2.png",
            bmClass: "bm"
		}, {
			"pagePath": "/pages/User/User",
			"text": "我的",
			"iconPath": "/images/User1.png",
			"selectedIconPath": "/images/User2.png"
 
		}]
	},
	ready: function() {
        this.setData({
          selected: app.globalData.selected
        })
      },
      /**
       * 组件的方法列表
       */
      methods: {
        switchTab(e) {
          // console.log(e);
          const data = e.currentTarget.dataset;
          const url = data.path;
          app.globalData.selected = data.index;
          wx.switchTab({url})
        }
      }
});
